package com.dream.myqiyi.search;
/***
 * @deprecated  2013.8.2
 * */

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;

import com.dream.myqiyi.R;

import java.util.List;

public class GudingzichanAdapter extends BaseAdapter {
   private static final String TAG="CaiwujihuaAdapter";
   private Context context;
   public List<GudingzichanObject> showlist=null;

    public GudingzichanAdapter(Context context, List<GudingzichanObject> list){
       this.showlist =list;
	   this.context=context;

   }
    @Override
	public int getCount() {
		return showlist.size();
	}

	@Override
	public Object getItem(int position) {
		return showlist.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
         ViewHolder holder;
         if (convertView != null) {
	        	holder = (ViewHolder) convertView.getTag();  
	        } else {  
	        	LayoutInflater mInflater=LayoutInflater.from(context);
	        	convertView= mInflater.inflate(R.layout.caiwujihua_item_view, null);
	            holder = new ViewHolder(); 
	            holder.planname = (TextView) convertView.findViewById(R.id.caiwu_showplanname);
	            holder.areaname= (TextView) convertView.findViewById(R.id.caicu_showareaname);
                holder.currentleve=(TextView)convertView.findViewById(R.id.caicu_showcurrentlevel);
	            convertView.setTag(holder);
	            
	        }

            GudingzichanObject dudingObject=showlist.get(position);
            holder.planname.setText(dudingObject.getCode());
            holder.areaname.setText(dudingObject.getName());
            holder.currentleve.setText(dudingObject.getUnitname());

	       return convertView; 
	}
	
	/** Creates a ViewHolder and store references to the related children views
	 */  
	    class ViewHolder {
	        TextView planname;
	        TextView areaname;
            TextView currentleve;

	    }

	
	    
}
